<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width,initial-scale=1,user-scalable=0">
    <meta name="renderer" content="webkit">
    <title>大众之旅</title>
    <link href="/static/home/css/normalize.css" rel="stylesheet">
    <link href="/static/home/css/bootatrap/bootstrap.min.css" rel="stylesheet">
    <link href="/static/home/css/mixin.css" rel="stylesheet">
    <link href="/static/home/css/style.css" rel="stylesheet">
    <style type="text/css">
        .with_info_item input::-webkit-input-placeholder{
            font-size:12px;
        }
        #qrcode img{margin:auto;}
    </style>
</head>

<body>
    <!-- 头部 -->
    <header class="boder_bn">
        <div class="top">
            <div class="typearea">
                <div class="fl">
                    <span>欢迎来到大众之旅!</span>
                    <a href="{:url('login/login')}" class="login_ing"><span class="ml_15 color_o">请登录</span></a>
                    <a href="{:url('login/register')}" class="login_ing"><span class="ml_15">会员注册</span></a>
                    <a class="login_ed"><span class="ml_15 color_o">{if $Think.session.userinfo.username}{$Think.session.userinfo.username}{else}{$Think.session.userinfo.phone}{/if}</span></a>
                    <a class="login_ed login_out" style="cursor:pointer;"><span class="ml_15">退出!</span></a>
                </div>
                <div class="fr">
                    <a href="{:url('my/my')}#order"><span>我的订单</span></a>
                    <a href="{:url('my/my_cart')}"><span class="ml_30">我的购物车</span></a>
                </div>
            </div>
        </div>
        <div class="center">
            <div class="typearea">
                <div class="fl">
                    <img class="logo_img" src="/static/home/img/logo.png" alt="">
                </div>
                <div class="fr">
                    <div class="search input-group">
                        <input type="text" class="form-control" name="keyword">
                        <div class="search_btn btn-group">
                            <a id="search" class="btn">
                                <img src="/static/home/img/s.jpg" alt="">
                            </a>
                        </div>
                    </div>
                    <!-- <div class="mycart">
                        <img src="/static/home/img/cart.png" alt="">
                        <span>我的购物车(0)</span>
                    </div> -->
                </div>
            </div>
        </div>
        <div class="bottom">
            <div class="typearea">
                <div class="fl">
                    <!-- Single button -->
                    <div class="btn-group">
                        <div class="all_product">
                            <div data-toggle="dropdown"
                                aria-haspopup="true" aria-expanded="false">
                                全部商品分类 <span class="caret"></span>
                            </div>
                            <ul class="dropdown-menu" style="height:unset;">
                                {foreach $cates as $key=>$value }
                                    <li>
                                        <a href="{:url('product/product')}?c_id={$value.id}">
                                            <div class="fl">
                                                <p>{$value.catename}</p>
                                                <p class="gray">{$value.intro}</p>
                                            </div>
                                            <span class="glyphicon glyphicon-menu-right fr"></span>
                                        </a>
                                    </li>
                                {/foreach}
                            </ul>
                        </div>
                    </div>
                </div>
                <div class="fr">
                    <ul>
                        <li><a href="{:url('index/index')}">商城首页</a></li>
                        <li><a href="{:url('product/product')}">农副产品</a></li>
                        <li><a href="{:url('scenic/scenic')}?flag_type=0">景区门票</a></li>
                        <li><a href="{:url('scenic/scenic')}?flag_type=2">免费景区</a></li>
                        <li><a href="{:url('product/product')}?discount=1">折扣专区</a></li>
                    </ul>
                </div>
            </div>
        </div>
    </header>
    <!-- 个人中心 -->
    <div class="my clearfix">
        <div class="crumbs">
            <div class="typearea">
                <div class="typearea">
                    <ol class="breadcrumb">
                        <li class="active">当前 : 个人中心</li>
                    </ol>
                </div>
            </div>
        </div>
        <div class="typearea">
            <div class="my_header">
                <div class="avator">
                    <img src="/static/home/img/my1.jpg" alt="">
                </div>
                <div class="info">
                    <div class="name">{$Think.session.userinfo.username}</div>
                    <div class="mt_5">普通会员</div>
                </div>
                <ul>
                    <li>
                        <div>待付款</div>
                        <div>{$wpay_count}</div>
                    </li>
                    <li>
                        <div>待发货</div>
                        <div>{$wfh_count}</div>
                    </li>
                    <li>
                        <div>待收货</div>
                        <div>{$wsh_count}</div>
                    </li>
                    <li>
                        <div>已完成</div>
                        <div>{$finish_count}</div>
                    </li>
                </ul>
            </div>
            <div class="my_menu">
                <div class="top">个人中心</div>
                <!-- Nav tabs -->
                <ul role="tablist">
                    <li role="presentation">
                        <a href="{:url('my/my')}#order" aria-controls="order" role="tab" data-toggle="tab">
                            <img src="/static/home/img/my2.jpg" alt="">
                            <span class="ml_5">我的订单</span>
                        </a>

                    </li>
                    <!-- <li role="presentation">
                        <a href="#info" aria-controls="info" role="tab" data-toggle="tab">
                            <img src="/static/home/img/my3.jpg" alt="">
                            <span class="ml_5">编辑资料</span>
                        </a>

                    </li> -->
                    <li role="presentation">
                        <a href="#address" aria-controls="address" role="tab" data-toggle="tab">
                            <img src="/static/home/img/my4.jpg" alt="">
                            <span class="ml_5">地址管理</span>
                        </a>

                    </li>
                    <li role="presentation">
                        <a href="#password" aria-controls="password" role="tab" data-toggle="tab">
                            <img src="/static/home/img/my5.jpg" alt="">
                            <span class="ml_5">修改密码</span>
                        </a>

                    </li>
                    <li role="presentation">
                        <a href="#distribution " aria-controls="distribution" role="tab" data-toggle="tab">
                            <img src="/static/home/img/my6.jpg" alt="">
                            <span class="ml_5">分销中心</span>
                        </a>

                    </li>
                    <li role="presentation">
                        <a href="#distributionOrder " aria-controls="distribution" role="tab" data-toggle="tab">
                            <img src="/static/home/img/my6.jpg" alt="">
                            <span class="ml_5">分销订单</span>
                        </a>

                    </li>
                    <li role="presentation">
                        <a href="#distributionTeam" aria-controls="distribution" role="tab" data-toggle="tab">
                            <img src="/static/home/img/my6.jpg" alt="">
                            <span class="ml_5">我的团队</span>
                        </a>

                    </li>
                    <li role="presentation">
                        <a href="#distributionDetail" aria-controls="distribution" role="tab" data-toggle="tab">
                            <img src="/static/home/img/my6.jpg" alt="">
                            <span class="ml_5">账单明细</span>
                        </a>

                    </li>  
                    
                    <li role="presentation">
                        <a href="#withdraw" aria-controls="distribution" role="tab" data-toggle="tab">
                            <img src="/static/home/img/my6.jpg" alt="">
                            <span class="ml_5">余额提现</span>
                        </a>

                    </li>
                    <li role="presentation">
                        <a href="#myCode" aria-controls="distribution" role="tab" data-toggle="tab">
                            <img src="/static/home/img/my6.jpg" alt="">
                            <span class="ml_5">我的二维码</span>
                        </a>

                    </li>
                    <!-- <li role="presentation">
                        <a href="#withdrawSuccess" aria-controls="distribution" role="tab" data-toggle="tab">
                            <img src="/static/home/img/my6.jpg" alt="">
                            <span class="ml_5">提现成功</span>
                        </a>

                    </li> -->  
                </ul>
            </div>
            <!-- Tab panes -->
            <div class="tab-content fr">
                <!-- 我的订单 -->
                <div role="tabpanel" class="tab-pane my_order" id="order">
                    <div class="top">我的订单</div>
                    {foreach $items as $key=>$value }
                    <a>
                        <div class="order_item">
                            <div class="item_num">订单编号：{$value.ordernosub}</div>
                            <ul class="item_contant">
                                <li>
                                    <img src="{$value.img}">
                                </li>
                                <li class="ml_10">
                                    <div><a href="{:url('order/order_detail')}?id={$value.id}">{$value.title}</a></div>
                                    <div class="type">{$value.combination}</div>
                                </li>
                                <li>¥{$value.price}</li>
                                <li>× {$value.buy_num}</li>
                                <li>
                                    <div>¥{$value.pay_fee}</div>
                                    <!-- <div>（含运费 ¥10元）</div> -->
                                    
                                </li>
                                <li class="fr">
                                    <!-- <button type="button" class="btn btn-default">提醒发货</button> -->
                                    {if $value.state==1}
                                        <div>待付款</div>
                                        <button type="button" onclick="cancel({$value.id})" class="btn btn-default">取消订单</button>
                                    {elseif $value.state==2}
                                        <div>待发货</div>
                                    {elseif $value.state==3}
                                        <div>待收货</div>
                                    {elseif $value.state==4}
                                        <div>已完成</div>
                                    {elseif $value.state==5}
                                    {elseif $value.state==6}
                                        <div>已取消</div>
                                    {/if}
                                </li>
                            </ul>
                        </div>
                    </a>
                    {/foreach}
                    <div class="product_page">
                        <nav aria-label="Page navigation pagelist">
                            {$ordersubs->render()|raw}
                        </nav>
                    </div>
                </div>
                <!-- 编辑资料 -->
                <!-- <div role="tabpanel" class="tab-pane edit_info" id="info">
                    <div class="top">编辑资料</div>
                    <div class="item mt_30">
                        <span>用户名称 :</span>
                        <div class="form-group">
                            <input type="password" class="form-control" placeholder="请输入用户名称">
                        </div>
                    </div>
                    <div class="item">
                        <span>手机号码 :</span>
                        <div class="form-group">
                            <input type="password" class="form-control" placeholder="请输入手机号码">
                        </div>
                    </div>
                    <div class="gender">
                        <span>性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别 :</span>
                        <div class="gender_choose">
                            <label class="radio-inline">
                                <input type="radio" name="inlineRadioOptions" id="inlineRadio1" value="option1"> <span>男</span>
                              </label>
                              <label class="radio-inline">
                                <input type="radio" name="inlineRadioOptions" id="inlineRadio2" value="option2"> <span>女</span>
                            </label>
                        </div>

                    </div>
                    <button type="button" class="btn btn-default">提交</button>

                </div> -->
                <!-- 地址管理 -->
                <div role="tabpanel" class="tab-pane edit_address" id="address">
                    <div class="top">地址管理</div>
                    <input type="hidden" name="address_id" value="{$address_id}">
                    <div class="item mt_30">
                        <span>收&nbsp;&nbsp;件&nbsp;&nbsp;人 :</span>
                        <div class="form-group">
                            <input type="text" name="name" class="form-control" value="{if $addressDetail}{$addressDetail.name}{/if}" placeholder="请输入收件人姓名">
                        </div>
                    </div>
                    <div class="item">
                        <span>联系电话 :</span>
                        <div class="form-group">
                            <input type="text" name="phone" class="form-control" value="{if $addressDetail}{$addressDetail.phone}{/if}" placeholder="请输入联系电话">
                            <span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span>
                        </div>
                    </div>
                    <div class="item area">
                        <span>选择省市 :</span>
                        <div class="province1">
                            <select name="province" id="province1" onchange="funSelect(this,1);" class="select form-control">
                              <option value="">&nbsp;—请选择—&nbsp;</option>
                              {foreach $province as $key=>$vo}
                                <option value="{$vo.areaId}" {if $vo.areaName==$addressDetail.province}selected{/if}>{$vo.areaName}</option>
                              {/foreach}
                            </select>
                        </div>
                        {if $city}
                        <span class="select-box province2" style="width:150px;">
                            <select name="city" id="province2" onchange="funSelect(this,2);" class="select form-control">
                              {foreach $city as $key=>$vo}
                                <option value="{$vo.areaId}" {if $vo.areaName==$addressDetail.city}selected{/if}>{$vo.areaName}</option>
                              {/foreach}
                            </select>
                        </span>
                        {/if}
                        {if $district}
                        <span class="select-box province3" style="width:150px;">
                            <select name="district" id="province3" onchange="funSelect(this,3);" class="select form-control">
                              {foreach $district as $key=>$vo}
                                <option value="{$vo.areaId}" {if $vo.areaName==$addressDetail.district}selected{/if}>{$vo.areaName}</option>
                              {/foreach}
                            </select>
                        </span>
                        {/if}
                    </div>
                    <div class="item">
                        <span>详细地址 :</span>
                        <div class="form-group">
                            <input type="text" name="address" class="form-control" value="{if $addressDetail}{$addressDetail.address}{/if}" placeholder="请输入详细地址">
                            <span class="glyphicon glyphicon-ok form-control-feedback" aria-hidden="true"></span>
                        </div>
                    </div>
                    <div class="item">
                        <div class="form-group">
                            <button id="submit_address" style="margin-left:78px;" type="button" class="btn btn-default">提交</button>
                        </div>
                    </div>
                    <div class="list">
                        <table class="table table-bordered">
                            <thead>
                                <tr>
                                    <td>收货人</td>
                                    <td>所在地区</td>
                                    <td>详细地址</td>
                                    <td>电话/手机</td>
                                    <td>操作</td>
                                    <td></td>
                                </tr>
                            </thead>
                            <tbody>
                                {foreach $addresses as $key=>$vo}
                                <tr>
                                    <td><div>{$vo.name}</div></td>
                                    <td><div>{$vo.province}{$vo.city}{$vo.district}</div></td>
                                    <td><div>{$vo.address}</div></td>
                                    <td><div>{$vo.phone}</div></td>
                                    <td>
                                        <div>
                                        <span class="edit" onclick="edit_address({$vo.id})">修改</span>
                                        <span class="ml_5">|</span>
                                        <span class="delete ml_5" onclick="delete_address({$vo.id})">删除</span>
                                        </div>
                                    </td>
                                    <td>
                                        <div style="cursor:pointer;" onClick="state_on({$vo.id},{$vo.state});" class="default {if $vo.state==1}default_active{/if}">设为默认</div>
                                    </td>
                                </tr>
                                {/foreach}
                            </tbody>
                        </table>
                    </div>
                </div>
                <!-- 修改密码 -->
                <div role="tabpanel" class="tab-pane edit_info" id="password">
                    <div class="top">修改密码</div>
                    <div class="item mt_30">
                        <span>登录密码 :</span>
                        <div class="form-group">
                            <input type="password" name="password" value="" class="form-control" placeholder="请输入登录密码">
                        </div>
                    </div>
                    <div class="item">
                        <span>新的密码 :</span>
                        <div class="form-group">
                            <input type="password" name="new_password" value="" class="form-control" placeholder="请输入新的密码">
                        </div>
                    </div>
                    <div class="item">
                        <span>确认密码 :</span>
                        <div class="form-group">
                            <input type="password" name="confirm_password" value="" class="form-control" placeholder="请确认密码">
                        </div>
                    </div>
                    <button type="button" onclick="change_password()" class="btn btn-default">提交</button>
                </div>
                <!-- 分销中心 -->
                <div role="tabpanel" class="tab-pane my_distribution " id="distribution">
                    <div class="top">我的分销</div>
                    <div class="contant">
                        <div class="cont_t">
                            <div class="item">
                                <div>累积佣金</div>
                                <div>¥{$in_money}</div>
                            </div>
                            <div class="item border_lr">
                                <div>消费佣金</div>
                                <div>¥{$out_money}</div>
                            </div>
                            <div class="item">
                                <div>累积提现</div>
                                <div>¥{$withdraw_money}</div>
                            </div>
                        </div>
                        <div class="cont_c clearfix">
                            <div class="fr">
                                <span>账户余额</span>
                                <span>¥{$my_money}</span>
                                <a class="btn-group" href="#withdraw" aria-controls="distribution" role="tab" data-toggle="tab">
                                    <div class="btn">去提现</div>
                                </a>
                            </div>
                        </div>
                        <div class="cont_d">
                            <a href="#distributionTeam" data-toggle="tab" class="cont_d_item">
                                <img src="/static/home/img/my7.jpg" alt="">
                                <div>我的团队</div>
                            </a>
                            <a href="#distributionOrder" data-toggle="tab" class="cont_d_item mlr_16"  id="to_distributionOrder">
                                <img src="/static/home/img/my8.jpg" alt="">
                                <div>分销订单</div>
                            </a>
                            <a href="#distributionDetail" data-toggle="tab" class="cont_d_item">
                                <img src="/static/home/img/my9.jpg" alt="">
                                <div>账单明细</div>
                            </a>
                        </div>
                    </div>
                </div>
                <!-- 分销订单 -->
                <div role="tabpanel" class="tab-pane distribution_order clearfix" id="distributionOrder">
                    <div class="top">分销订单</div>
                    <div class="contant">

                        {foreach $distributor_orders_items as $key=>$value }
                        <div class="dist_item">
                            <img class="dist_item_img" src="{if $value.img}{$value.img}{else}/static/home/img/p1.jpg{/if}">
                            <div class="dist_item_info">
                                <div>{$value.title}</div>
                                <div>来自：{$value.phone}&nbsp;&nbsp;&nbsp;&nbsp;{$value.time}</div>
                            </div>
                            <div class="fr">
                                <div>¥{$value.pay_fee}</div>
                                <div class="price">+{$value.money}</div>
                            </div>
                        </div>
                        {/foreach}

                        <div class="product_page">
                            <nav aria-label="Page navigation pagelist">
                                {$distributor_orders->render()|raw}
                            </nav>
                        </div>
                        <!-- 分页 -->
                        <!-- <div class="fr">
                            <nav aria-label="Page navigation">
                                <ul class="pagination pagination-lg clearfix">
                                <li>
                                    <a href="#" aria-label="Previous">
                                    <span aria-hidden="true">&laquo;</span>
                                    </a>
                                </li>
                                <li><a href="#">1</a></li>
                                <li><a href="#">2</a></li>
                                <li><a href="#">3</a></li>
                                <li><a href="#">4</a></li>
                                <li><a href="#">5</a></li>
                                <li>
                                    <a href="#" aria-label="Next">
                                    <span aria-hidden="true">&raquo;</span>
                                    </a>
                                </li>
                                </ul>
                            </nav>
                        </div> -->
                    </div>
                </div>
                <!--我的团队 -->
                <div role="tabpanel" class="tab-pane distribution_team " id="distributionTeam">
                    <div class="top">我的团队</div>
                    <div class="contant">

                        {foreach $team_items as $key=>$value }
                        <div class="team_item">
                            <img class="dist_item_img" src="{if $value.headimgurl}{$value.headimgurl}{else}/static/home/img/avatar.jpg{/if}">
                            <div class="dist_item_info">
                                <div>{$value.phone}</div>
                                <div>{$value.time}<span>贡献{$value.nums}单</span></div>
                            </div>
                        </div>
                        {/foreach}
                    </div>
                    <div class="product_page">
                        <nav aria-label="Page navigation pagelist">
                            {$my_teams->render()|raw}
                        </nav>
                    </div>
                </div>
                <!-- 账单明细 -->
                <div role="tabpanel" class="tab-pane distribution_order " id="distributionDetail">
                    <div class="top">账单明细</div>
                    <div class="contant">
                        {foreach $withdraw_bills_items as $key=>$value }
                        <div class="dist_item">
                            <div class="dist_item_info">
                                <div>{$value.des}</div>
                                <div>{$value.time}</div>
                            </div>
                            <div class="fr">
                                <div class="">{if $value.type==2}-{else}+{/if}{$value.money}</div>
                            </div>
                        </div>
                        {/foreach}
                    </div>
                    <div class="product_page">
                        <nav aria-label="Page navigation pagelist">
                            {$withdraw_bills->render()|raw}
                        </nav>
                    </div>
                </div>
                <!-- 余额提现 -->
                <div role="tabpanel" class="tab-pane withdraw " id="withdraw">
                    <div class="top">余额提现</div>
                    <div class="contant">
                        <div>
                            <div class="cont_box">
                                <div>累计提现</div>
                                <div>{$withdraw_money}</div>
                            </div>
                            <div class="cont_box fr">
                                <div>可提金额</div>
                                <div>{$my_money}</div>
                            </div>
                        </div>
                        <div>
                            <h3>提现方式：</h3>
                            <p>1、转账方式，填写银行卡或支付宝相关信息提交，待工作人员打款(非工作日可能延长几天)。</p>
                            <p>2、在线提现，扫码或搜索微信公众号"大众游天下"进入微信端商城进入个人中心->分销中心提现(实时到账微信零钱、如有疑问请联系客服)</p>

                            <div id="qrcode" class="code_img"></div>

                        </div>
                        <div class="with_info">
                            <div class="with_info_item">
                                <span>提&nbsp;现&nbsp;金&nbsp;额：</span>
                                <div class="info_item_b">
                                    <div>¥</div>
                                    <input onkeyup="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}" onafterpaste="if(this.value.length==1){this.value=this.value.replace(/[^1-9]/g,'')}else{this.value=this.value.replace(/\D/g,'')}" type="number" name="cashes" placeholder="请输入金额">
                                </div>
                            </div>
                            <div class="with_info_item">
                                <span>姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名：</span>
                                <div class="info_item_b">
                                    <!-- <div><img src="/static/home/img/my10.jpg" alt=""></div> -->
                                    <input type="text" name="withdraw_name" placeholder="请输入姓名">
                                </div>
                            </div>
                            <div class="with_info_item">
                                <span>账&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号：</span>
                                <div class="info_item_b">
                                    <input type="text" name="card_no" placeholder="请输入支付宝或银行卡账号">
                                </div>
                            </div>
                            <div class="with_info_item">
                                <span>银行/支付宝：</span>
                                <div class="info_item_b">
                                    <input type="text" name="bank" placeholder="请输入银行名称或支付宝">
                                </div>
                            </div>
                        </div>
                        <div class="submit">
                            <div class="btn-group">
                                <div class="btn" id="withdraw_submit">提交</div>
                            </div>
                        </div>
                        
                    </div>
                </div>
                <!-- 我的二维码 -->
                <div role="tabpanel" class="tab-pane myCode " id="myCode">
                    <div class="top">我的二维码</div>
                    <div class="contant">
                        <div class="box">
                            <div id="invite_code" class="box_img"></div>
                            <div class="box_invite">邀请码：{$invite_code}</div>
                            <div>识别二维码，邀请朋友一起分享好物，</div>
                            <div>还可赚取分享佣金</div>
                        </div>
                    </div>
                </div>
                <!-- 提现成功 -->
                <div role="tabpanel" class="tab-pane withdrawSuccess " id="withdrawSuccess">
                    <div class="top">提现成功</div>
                    <div class="contant clearfix">
                        <div class="box">
                            <div class="box_img">
                                <img src="/static/home/img/finish.jpg" alt="">
                            </div>
                            <div class="fs_24">申请提现成功</div>
                            <div>您的提现申请成功，预计2个工作日内到账！</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!-- 尾部 -->
    <footer>
        <div class="f_top">
            <div class="typearea">
                <ul>
                    <li>
                        <img src="/static/home/img/b1.jpg" alt="">
                        <span>正品保障</span>
                    </li>
                    <li>
                        <img src="/static/home/img/b2.jpg" alt="">
                        <span>好评如潮</span>
                    </li>
                    <li>
                        <img src="/static/home/img/b3.jpg" alt="">
                        <span>闪电发货</span>
                    </li>
                    <li>
                        <img src="/static/home/img/b4.jpg" alt="">
                        <span>权威荣誉</span>
                    </li>
                </ul>
            </div>
        </div>
        <div class="f_center">
            <div class="typearea">
                <div class="contact">
                    <div class="con_t">
                        <img src="/static/home/img/b5.jpg" alt="">
                        <div class="con_tr ml_10">
                            <div>{$system.ser_tel}</div>
                            <div>服务时间：{$system.ser_time}</div>
                        </div>
                    </div>
                    <div class="mt_20">地址：{$system.address}</div>
                    <div class="mt_20">邮箱：{$system.email}</div>
                </div>
                <ul>
                    <li>购物指南</li>
                    <li><a href="javascript:0">我的购物车</a></li>
                    <li><a href="javascript:0">查看订单</a></li>
                    <li><a href="javascript:0">取消订单</a></li>
                </ul>
                <ul>
                    <li>帮助中心</li>
                    <li><a href="javascript:0">用户注册</a></li>
                    <li><a href="javascript:0">用户登录</a></li>
                    <li><a href="javascript:0">配送说明</a></li>
                </ul>
                <ul>
                    <li>服务保证</li>
                    <li><a href="javascript:0">产品质量保证</a></li>
                    <li><a href="javascript:0">售后服务保证</a></li>
                    <li><a href="javascript:0">联系我们</a></li>
                </ul>
                <div class="fr">
                    <div>
                        <div id="qy_qrcode">
                            
                        </div>
                        <p style="text-align:center;">企业官网</p>
                    </div>
                    <div class="ml_30">
                        <div id="shop_qrcode">
                            
                        </div>
                        <p style="text-align:center;">微信商城</p>
                    </div>
                </div>
            </div>
        </div>
        <div class="f_bottom">
            <div class="typearea">
                版权所有 ©{$system.copyright}&nbsp;&nbsp;&nbsp;&nbsp;{$system.company}&nbsp;&nbsp;&nbsp;&nbsp;{$system.icp}
            </div>
        </div>
    </footer>
    
    <script src="/static/home/js/bootstrap/jquery.min.js"></script>
    <script src="/static/home/js/bootstrap/bootstrap.min.js"></script>
    <script src="/static/home/js/qrcode.min.js"></script>
    <script src="/static/lib/layer/2.4/layer.js"></script>
    <script>
        var qrcode = new QRCode(document.getElementById("qy_qrcode"), {
            text: "{$url}/index/index/index.html",
            width: 88,
            height: 88,
            colorDark : "#000000",
            colorLight : "#ffffff",
            correctLevel : QRCode.CorrectLevel.H
        });

        var qrcode = new QRCode(document.getElementById("shop_qrcode"), {
            text: "{$url}/h5/index.html",
            width: 88,
            height: 88,
            colorDark : "#000000",
            colorLight : "#ffffff",
            correctLevel : QRCode.CorrectLevel.H
        });
        var qrcode = new QRCode(document.getElementById("qrcode"), {
            text: "{$url}/h5/index.html",
            width: 80,
            height: 80,
            colorDark : "#000000",
            colorLight : "#ffffff",
            correctLevel : QRCode.CorrectLevel.H
        });
        var qrcode = new QRCode(document.getElementById("invite_code"), {
            text: "{$url}/h5/index.html",
            width: 80,
            height: 80,
            colorDark : "#000000",
            colorLight : "#ffffff",
            correctLevel : QRCode.CorrectLevel.H
        });
        function funSelect(obj,indexSelect) {
            $.getJSON("{:url('cityDistrict')}",{areaId:$("#province"+indexSelect).val()},function(json){
                var indexSelectAdd = indexSelect+1;
                var indexSelectAddm = indexSelectAdd+1;
                $(".province"+indexSelectAdd).remove();
                $(".province"+indexSelectAddm).remove();
                if(json.code==200){
                    if(indexSelect == 1){
                        var objelement = '<span class="select-box province2" style="width:150px;">'+
                            '<select name="city" id="province2" onchange="funSelect(this,2);" class="select form-control">'+
                              '<option value="">&nbsp;—请选择—&nbsp;</option>';
                        for (var i = 0; i < json.data.length; i++) {
                            objelement = objelement+'<option value="'+json.data[i].areaId
                            +json.data[i].areaName
                            +'</option>'
                        }
                        objelement = objelement+
                            '</select>'+
                        '</span>';
                        $(".province1").after(objelement);
                    }
                    if(indexSelect == 2){
                        var objelement = '<span class="select-box province3" style="width:150px;">'+
                            '<select name="district" id="province3" onchange="funSelect(this,3);" class="select form-control">'+
                              '<option value="">&nbsp;—请选择—&nbsp;</option>';
                        for (var i = 0; i < json.data.length; i++) {
                            objelement = objelement+'<option value="'+json.data[i].areaId
                            +json.data[i].areaName
                            +'</option>'
                        }
                        objelement = objelement+
                            '</select>'+
                        '</span>';
                        $(".province2").after(objelement);
                    }
                }
            });
        }
        //获取#号值
        function GetRequest() {
          var str = location.href
          var num = str.indexOf("#");
          str = str.substr(num + 1);
          return str;
        }
        $(function(){

            var to_url=GetRequest();
            $("#"+to_url).addClass("active");

            if(window.localStorage.getItem("Token")){
                $(".login_ing").css("display","none");
                $(".login_ed").css("display","unset");
            }
            $(".login_out").click(function() {
                window.localStorage.setItem("Token",'');
                $(".login_ing").css("display","unset");
                $(".login_ed").css("display","none");
                $.ajax({
                    type: 'POST',
                    url: "{:url('/shop/login/login_out')}",
                    data:{},
                    success: function(data){
                        console.log(data)
                        window.location.href="/shop/index/index.html";
                    },
                    error:function(data) {
                        console.log(data.msg);
                    },
                }); 
            });
        });
        $("#submit_address").click(function() {
            if(window.localStorage.getItem("Token")){
                var token=window.localStorage.getItem("Token");
                var address_id=$("input[name=address_id]").val();
                var name=$("input[name=name]").val();
                var phone=$("input[name=phone]").val();
                var address=$("input[name=address]").val();
                // var province=$("#province1").val();
                // var city=$("#province2").val();
                // var district=$("#province3").val();
                var province=$("#province1").find("option:selected").text()
                var city=$("#province2").find("option:selected").text()
                var district=$("#province3").find("option:selected").text()
                var area_code=110000;
                if(address_id>0){
                    $.ajax({
                        type: 'POST',
                        url: "{:url('api/address/editAddress')}",
                        data: {token:token,name:name,phone:phone,address:address,province:province,city:city,district:district,area_code:area_code,state:2,id:address_id},
                        success: function(resdata){
                            if(resdata.code==200){
                                window.location.reload();
                            }else{
                                layer.msg(resdata.msg,{icon:2,time:3000});
                            }
                        },
                        error: function(){
                            layer.msg('失败',{icon:2,time:3000});
                        }
                    })
                }else{
                    $.ajax({
                        type: 'POST',
                        url: "{:url('api/address/addAddress')}",
                        data: {token:token,name:name,phone:phone,address:address,province:province,city:city,district:district,area_code:area_code,state:2},
                        success: function(resdata){
                            if(resdata.code==200){
                                window.location.reload();
                            }else{
                                layer.msg(resdata.msg,{icon:2,time:3000});
                            }
                        },
                        error: function(){
                            layer.msg('失败',{icon:2,time:3000});
                        }
                    })
                }
                
            }else{
                window.location.href="/shop/login/login.html";
            }
            
        });
        function edit_address(id){
            window.open("/shop/my/my.html?address_id="+id+'#address');
        }
        function state_on(id,state){
            $.post('{:url("state_on")}',
            {id:id,state:state},
            function(data){
                if(data.code==200){
                    window.location.reload();
                }else{
                    layer.msg('失败',{icon:2,time:3000});
                }
            });
        }
        function delete_address(id){
            var token=window.localStorage.getItem("Token");
            $.post('{:url("api/address/deleteAddress")}',
            {id:id,token:token},
            function(data){
                if(data.code==200){
                    window.location.reload();
                }else{
                    layer.msg('失败',{icon:2,time:3000});
                }
            });
        }
        function cancel(id){
            var token=window.localStorage.getItem("Token");
            $.post('{:url("api/orders/cancel")}',
            {id:id,token:token},
            function(res){
                if(res.code==200){
                    window.location.reload();
                }else{
                    layer.msg('失败',{icon:2,time:3000});
                }
            });
        }
        function change_password(){
            var token=window.localStorage.getItem("Token");
            var password=$("input[name=password]").val();
            var new_password=$("input[name=new_password]").val();
            var confirm_password=$("input[name=confirm_password]").val();
            if(new_password!=confirm_password){
                layer.msg('新密码与确认密码不一致',{icon:2,time:3000});
            }else{
                $.post('{:url("api/login/change_password")}',
                {password:password,token:token,new_password:new_password,confirm_password:confirm_password},
                function(res){
                    if(res.code==200){
                        $("input[name=password]").val('');
                        $("input[name=new_password]").val('');
                        $("input[name=confirm_password]").val('');
                        layer.msg(res.msg,{icon:1,time:3000});
                    }else{
                        layer.msg(res.msg,{icon:2,time:3000});
                    }
                });
            }
            
        }
        
        $("#search").click(function() {
            layer.load(1, {
              shade: [0.1,'#fff'] //0.1透明度的白色背景
            });
            var keyword=$("input[name=keyword]").val();
            window.location.href="{$url}/shop/product/product.html?keyword="+keyword
            ;
        });
        
        $("#withdraw_submit").click(function() {
            var token=window.localStorage.getItem("Token");
            var cashes=$("input[name=cashes]").val();
            var withdraw_name=$("input[name=withdraw_name]").val();
            var card_no=$("input[name=card_no]").val();
            var bank=$("input[name=bank]").val();
            $.post('{:url("api/money/cashout")}',
            {token:token,style:2,cashes:cashes,name:withdraw_name,card_no:card_no,bank:bank},
            function(res){
                if(res.code==200){
                    window.open("{$url}/shop/my/my.html#withdrawSuccess");
                }else{
                    layer.msg(res.msg,{icon:2,time:3000});
                }
            });
        });
    </script>
</body>

</html>